package com.module.overview.ui.historicalDataDetails

import com.chad.library.adapter.base.BaseProviderMultiAdapter
import com.chad.library.adapter.base.provider.BaseItemProvider
import com.common.app.data.bean.overView.HistoryDetailsModel
import com.common.app.widget.provider.CommonEmptyProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdActivityConsumptionCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdActivitySportsRecordCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdActivityStandingHoursCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdActivityStrengthDurationCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdActivityTotalScoreCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdDeepSleepDurationCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdLightSleepDurationCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdNapSleepDurationCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdRapidEyeMovementDurationCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdSignsHrCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdSleepBoxyCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdSleepBreathingRateCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdSleepHrCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdSleepSkinTemperatureCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdSleepSubjectiveScoringCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdSleepTotalDurationCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdSleepTotalScoreCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdStressReliefDurationCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdStressThroughoutDayCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdTotalBedRestDurationCardProvider
import com.module.overview.ui.historicalDataDetails.provider.OvHdWakefulnessDurationCardProvider

/**
 *
 * 作者：sosou
 *
 * 版本：1.0
 *
 * 创建日期：2025/08/07
 *
 * 描述：
 *
 * 修订历史：
 *
 */
class HistoricalDataCardAdapter(val mType: Int = 1) : BaseProviderMultiAdapter<HistoryDetailsModel>() {

    init {
        addItemProvider(CommonEmptyProvider<HistoryDetailsModel>())

        //压力相关
        addItemProvider(OvHdStressThroughoutDayCardProvider(mType))
        addItemProvider(OvHdStressReliefDurationCardProvider(mType))

        //体征相关
        addItemProvider(OvHdSignsHrCardProvider(mType))

        //睡眠相关
        addItemProvider(OvHdSleepTotalScoreCardProvider(mType))
        addItemProvider(OvHdSleepSubjectiveScoringCardProvider(mType))
        addItemProvider(OvHdSleepTotalDurationCardProvider(mType))
        addItemProvider(OvHdWakefulnessDurationCardProvider(mType))
        addItemProvider(OvHdTotalBedRestDurationCardProvider(mType))
        addItemProvider(OvHdRapidEyeMovementDurationCardProvider(mType))
        addItemProvider(OvHdLightSleepDurationCardProvider(mType))
        addItemProvider(OvHdDeepSleepDurationCardProvider(mType))
        addItemProvider(OvHdSleepHrCardProvider(mType))
        addItemProvider(OvHdSleepBoxyCardProvider(mType))
        addItemProvider(OvHdNapSleepDurationCardProvider(mType))
        addItemProvider(OvHdSleepSkinTemperatureCardProvider(mType))
        addItemProvider(OvHdSleepBreathingRateCardProvider(mType))

        //活动相关
        addItemProvider(OvHdActivityTotalScoreCardProvider(mType))
        addItemProvider(OvHdActivityStrengthDurationCardProvider(mType))
        addItemProvider(OvHdActivityConsumptionCardProvider(mType))
        addItemProvider(OvHdActivityStandingHoursCardProvider(mType))
        addItemProvider(OvHdActivitySportsRecordCardProvider(mType))

    }

    override fun getItemType(data: List<HistoryDetailsModel>, position: Int): Int {
        return data[position].itemType
    }

    fun getCusItemProvider(viewType: Int): BaseItemProvider<HistoryDetailsModel>? {
        return getItemProvider(viewType)
    }
}